﻿/**
 * @author catarina
 */
import SCUMMCore.Util;

class SCUMMCore.Legenda extends Object
{
	private var iFrames:Number = 1;
	private var sNome:String;
	
	
	public function Legenda( pmcItem:MovieClip, psTexto:String )
	{
		var thisObject:Legenda = this;
		this.sNome = pmcItem._name + "Legenda";
		
		_root.createTextField(this.sNome, 1, Util.xAbsoluto(pmcItem) - 30, Util.yAbsoluto(pmcItem) - 30, 300, 25);
		_root[this.sNome].multiline = true;
		_root[this.sNome].wordWrap = true;
		_root[this.sNome].text = psTexto;
		_root.onEnterFrame = function()
		{
			thisObject.contaTempo();
		};
	}
	
	private function contaTempo():Void
	{
		if ( this.iFrames > 20 )
			_root[this.sNome].removeTextField();
		else
			this.iFrames++;
	}	
}